Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[weekly-r319] MemPostings: keep a map of label values slices (#15426) #779

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

colega
Copy link
Contributor

@colega colega commented Dec 2, 2024

Cherry-pick of prometheus/prometheus#15426 into weekly-r319, as main isn't up to date with prometheus/main yet.

#778 was accidentally merged into main (which isn't a big deal, we're going to bring it through the usual merge process anyway)

While investigating lock contention on `MemPostings`, we saw that lots
of locking is happening in `LabelValues` and
`PostingsForLabelsMatching`, both copying the label values slices while
holding the mutex.

This adds an extra map that holds an append-only label values slice for
each one of the label names. Since the slice is append-only, it can be
copied without holding the mutex.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Copy link
Contributor

@krajorama krajorama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@colega colega merged commit 4a1b9cb into weekly-r319 Dec 2, 2024
16 checks passed
@colega colega deleted the weekly-r319-prometheus-15426 branch December 2, 2024 10:49
colega added a commit to grafana/mimir that referenced this pull request Dec 2, 2024
Updates mimir-prometheus weekly-r319 to grafana/mimir-prometheus#779

This includes the cherry-pick of prometheus/prometheus#15426

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
colega added a commit to grafana/mimir that referenced this pull request Dec 2, 2024
Updates mimir-prometheus weekly-r319 to grafana/mimir-prometheus#779

This includes the cherry-pick of prometheus/prometheus#15426

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants